{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">安全设置</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('admin/Secunity/upd')}" method="post">

                    <div class="layui-form-item">
                        <label class="layui-form-label">投票验证码</label>
                        <div class="layui-input-block">
                            <input type="radio" name="isCheckCode" value="0" title="开启"<?php if($picture['isCheckCode']=='0') echo " checked"; ?>>
                            <input type="radio" name="isCheckCode" value="1" title="关闭"<?php if($picture['isCheckCode']=='1') echo " checked"; ?>>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">投票区域限制</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="isLimitArea"  value="{$picture['isLimitArea']}" id="isLimitArea" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF" <?php if($picture['isLimitArea']=='1') echo " checked"; ?>>
                        </div>
                    </div>
                    <!--<input type="hidden" value="{$picture['isLimitArea']}">-->
                    <div class="layui-form-item" id="p1">
                        <label class="layui-form-label">区域名称</label>
                        <div class="layui-input-block">
                            <input name="limitArea" value="{$picture['limitArea']}"   placeholder="填写允许投票地区（微信GPS）" class="layui-input" style="width:200px">
                        </div>
                    </div>
                    <!--<div class="layui-form-item">-->
                        <!--<label class="layui-form-label">随机域名</label>-->
                        <!--<div class="layui-input-block">-->
                            <!--<input  name="randSite" value="{$picture['randSite']}" placeholder="域名" class="layui-input" style="width:200px;">-->
                        <!--</div>-->
                    <!--</div>-->

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" value="{$picture['id']}" name="id">
                            <button class="layui-btn" lay-submit lay-filter="*">更新</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    var isLimitArea=$("#isLimitArea").val();
    if(isLimitArea==1)
    {
        $("#p1").show();
    }else{
        $("#p1").hide();
    }
    //监听指定开关
    form.on('switch(switchTest)', function(){

        this.checked?$("#p1").show():$("#p1").hide();
    });
</script>
{/block}